package com.fu.servlet;

import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
import java.util.Set;

/**
 * @author 付大大
 * @description 注册配置Servlet的功能类
 * @create 2021-01-23 21:30
 */
public class MyRegister implements ServletContainerInitializer {
    @Override
    public void onStartup(Set<Class<?>> set, ServletContext servletContext) throws ServletException {
        ServletDemo02 servletDemo02 = new ServletDemo02();
        ServletRegistration.Dynamic registration = servletContext.addServlet("servletDemo02", servletDemo02);
        registration.addMapping("/servletDemo02");
    }
}
